package base.day21.MyHashSet2;

import java.util.HashSet;
import java.util.Iterator;

public class MyHashSet1 {
    public static void main(String[] args) {
        HashSet<String> hs=new HashSet<>();
        hs.add("ab");
        hs.add("b");
        hs.add("gc");
        hs.add("da");

        Iterator<String> it=hs.iterator();
        while (it.hasNext()){
            System.out.println(it.next());
        }
        for (String s : hs) {
            System.out.println(s);
        }
    }
}
